<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.themyleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css" th:href="@{/layui/css/layui.css}">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">电信话费缴费系统</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    贤心
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="">退了</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航）lay-filter="test" -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item">
                    <a href="javascript:;" data-target="/user/addUser">新用户开户</a>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="#">缴费模块</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" data-target="/user/preStor">预存话费</a></dd>
                        <dd><a href="javascript:;">固定缴费</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">活动模块</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" data-target="/user/exchange">刮刮卡兑换</a></dd>
                        <dd><a href="javascript:;">刮刮卡库存</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="javascript:;" data-target="/user/reportFrom">报表统计</a></li>
                <li class="layui-nav-item"><a href="javascript:;" data-target="/user/userManagement">用户管理</a></li>
            </ul>
        </div>
    </div>

    <div class="layui-body" style="overflow: hidden;">
        <!-- 内容主体区域 -->
        <!--<iframe src="/index" width="100%" height="100%"></iframe>-->
        <iframe src="../view/demo.html" id="contentIframe" width="100%" height="100%"></iframe>
        <!--<div style="padding: 15px;">内容主体区域</div>-->
    </div>
</div>
<script src="/static/layui/layui.js" th:src="@{/layui/layui.js}"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;
        element.on('nav(test)', function(elem){
            //console.log(elem); //得到当前点击的DOM对象
            var target =  elem.attr('data-target');
            //console.log(target);
            if(target!=undefined){
                document.getElementById('contentIframe').setAttribute("src",target);
            }
        });
    });
</script>
</body>
</html>